import { _decorator, Component, director, Node } from 'cc';
import { FadeManager } from '../../RunTime/FadeManager';
const { ccclass, property } = _decorator;


@ccclass('StartManager')
export class StartManager extends Component {

    protected onLoad(): void {
        director.preloadScene('Battle')
        FadeManager.getInstance().fadeOut(1000)
        this.node.once(Node.EventType.TOUCH_START, this.handleStart, this)
    }

    async handleStart(){
        await FadeManager.getInstance().fadeIn(300)
        director.loadScene('Battle')
    }

}
